<template>
    <div class="index_container">
    <el-container>
      <el-header>Header</el-header>
      <el-main>{{ booksList }}</el-main>
      <el-footer>Footer</el-footer>
    </el-container>
    </div>
</template>
<script>
export default {
    date(){
        return{
            booksList:[]//商品数组
        }
    },
    methods: {
        /**
         * 获得商品信息
         */
       queryBooks(){
        this.$axios
                .get("book/queryBooks")
                .then(response=>{
                    this.booksList =response.data;
                })
                .catch(err=>{
                    alert(err)
                })
       }
    },
    created(){
        this.queryBooks();
    }
}
</script>
<style scoped>
.index_container{
    margin: 0px auto;
    width: 80%;

}
 .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }
</style>